﻿
#region Using Directives.

using System.ComponentModel;
using System.Drawing;
using ActiproSoftware.SyntaxEditor;
using System.Windows.Forms;
using TD.SandDock.Rendering;
using TD.SandDock;
using System;

#endregion

namespace RWXMLEdit.UserControls
{
    public partial class UCXmlInput : UserControl
    {
        #region Delegates.

        //public delegate void SelectedDocumentTabChangedEventHandler(object sender, SelectedDocumentTabChangedEventArgs e);

        #endregion

        #region Events.

        //public event SelectedDocumentTabChangedEventHandler SelectedDocumentTabChangedEvent;

        #endregion

        #region Fields.

        //private string _inputGroupBoxName;
        //private string _mainGroupBoxName;
        private string _imagePath;
        //private string _currentTabName;
        //private SyntaxEditor _currentEditor;

        #endregion

        #region Constructors.

        public UCXmlInput()
        {
            InitializeComponent();

            grbMain.Text = "UCXMLInput";
            grbInput.Text = "UCXMLEditInput";
        }

        #endregion

        [Category("Input Image File")]
        [Browsable(true)]
        [Description("Set path to image file.")]
        [Editor(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public string PictureFile
        {
            get
            {
                return _imagePath;
            }
            set
            {
                _imagePath = value;

                if (!string.IsNullOrEmpty(_imagePath))
                {
                    // set the image to the image file
                    picMain.Image = Image.FromFile(_imagePath);


                    // resize the image to match the image file
                    //picMain.Size = picMain.Image.Size;
                    //picMain.Image.Size = picMain.Size;
                }
            }
        }

        [Category("Input Edit Controls")]
        [Browsable(true)]
        [Description("The name of the main groupbox")]
        [DefaultValue("UCXMLInput")]
        public string MainGroupBoxName
        {
            get { return grbMain.Text; }
            set { grbMain.Text = value; }
        }

        [Category("Input Edit Controls")]
        [Browsable(true)]
        [Description("The name of the input controls groupbox")]
        [DefaultValue("UCXMLEditInput")]
        public string EditGroupBoxName
        {
            get { return grbInput.Text; }
            set { grbInput.Text = value; }
        }
    }
}
